/**
 * Created by Administrator on 2022/8/6.
 */
public class Demo {
    /*public static void main(String[] args) {
        //实现一个函数，检测一个年份是否为闰年
        int year = 2022;
        boolean r = isLeapYear(year);
        if(r){
            System.out.println("yes");
        }else{
            System.out.println("no");
        }
    }
    public static boolean isLeapYear(int year){
        if((year % 4 == 0 && year %100 != 0) || year % 400 == 0){
            return true;
        }
        return false;
    }*/

    /*public static void main(String[] args) {
        //实现一个两个整数相加的方法
        int a = 2;
        int b = 7;
        int s = sum(a,b);
        System.out.println(s);
    }
    public static int sum(int num1,int num2){
        return num1 + num2;
    }*/

    /*public static void main(String[] args) {
        //计算 1! + 2! + 3! + 4! + 5!
        int a = 5;
        int sum = 0;
        for (int i = 1; i <= 5; i++) {
            sum += fac(i);//i是实参
        }
        System.out.println(sum);
    }
    public static int fac(int a){//a是形参
        int  result = 1;
        for (int i = 1; i <= a; i++) {
            result *= i;
        }
        return result;
    }*/

    /*public static void main(String[] args) {
        int a = 6;
        int b = 7;
        print(a,b);
    }
    public static void print(int a,int b){
        int c = a + b;
        System.out.println(a+"+"+b+"="+c);
    }*/

   /* public static void main(String[] args) {
        //方法重载
        int a = 6;
        int b = 7;
        System.out.println(add(a,b));
        int c = 9;
        System.out.println(add(a,b,c));
    }

    public static int add(int a,int b){
        return a + b;
    }

    public static int add(int a,int b,int c){
        return a + b + c;
    }*/

}
